package com.zkthink.ceres.promotion.entity;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 实体类 营销活动申请日志表
 * </p>
 *
 * @author kellen
 * @since 2020-06-27
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_promotion_audit_log")
@ApiModel(value = "PromotionAuditLog", description = "营销活动申请日志表")
@AllArgsConstructor
public class PromotionAuditLog extends Entity<Long> {

  private static final long serialVersionUID = 1L;

  /**
   * 营销活动id
   */
  @ApiModelProperty(value = "营销活动id")
  @NotNull(message = "营销活动id不能为空")
  @TableField("promotion_id")
  @Excel(name = "营销活动id")
  private Long promotionId;

  /**
   * 申请id
   */
  @ApiModelProperty(value = "申请id")
  @NotNull(message = "申请id不能为空")
  @TableField("apply_id")
  @Excel(name = "申请id")
  private Long applyId;

  /**
   * 步骤 1:报名  2审核通过 3审核不通过
   */
  @ApiModelProperty(value = "步骤 1:报名  2审核通过 3审核不通过")
  @NotNull(message = "步骤 1:报名  2审核通过 3审核不通过不能为空")
  @TableField("process_stage")
  @Excel(name = "步骤 1:报名  2审核通过 3审核不通过")
  private Integer processStage;

  /**
   * 审核人
   */
  @ApiModelProperty(value = "审核人")
  @NotEmpty(message = "审核人不能为空")
  @Length(max = 64, message = "审核人长度不能超过64")
  @TableField(value = "audit_by", condition = LIKE)
  @Excel(name = "审核人")
  private String auditBy;

  /**
   * 审核备注
   */
  @ApiModelProperty(value = "审核备注")
  @NotEmpty(message = "审核备注不能为空")
  @Length(max = 255, message = "审核备注长度不能超过255")
  @TableField(value = "audit_remark", condition = LIKE)
  @Excel(name = "审核备注")
  private String auditRemark;

  /**
   * 是否删除0否 1是
   */
  @ApiModelProperty(value = "是否删除0否 1是")
  @NotNull(message = "是否删除0否 1是不能为空")
  @TableField("is_delete")
  @Excel(name = "是否删除0否 1是")
  private Integer isDelete;


  @Builder
  public PromotionAuditLog(Long id, LocalDateTime createTime, Long createUser,
      LocalDateTime updateTime, Long updateUser,
      Long promotionId, Long applyId, Integer processStage, String auditBy, String auditRemark,
      Integer isDelete) {
    this.id = id;
    this.createTime = createTime;
    this.createUser = createUser;
    this.updateTime = updateTime;
    this.updateUser = updateUser;
    this.promotionId = promotionId;
    this.applyId = applyId;
    this.processStage = processStage;
    this.auditBy = auditBy;
    this.auditRemark = auditRemark;
    this.isDelete = isDelete;
  }

}
